home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
(A)TA
/
(A)TAS.ADF
/
clock297
/
clock297.asm
< prev
Wrap
Assembly Source File
|
1988-09-05
|
90KB
|
4,214 lines
* * Clockdj *
nolist
********* assembler offset files needed for this to work
include "exec/types.i"
include "exec/nodes.i"
include "exec/lists.i"
INCLUDE "exec/interrupts.i"
INCLUDE "devices/input.i"
INCLUDE "hardware/intbits.i"
INCLUDE "devices/inputevent.i"
include "offsets/rom.ofs"
include "exec/io.i"
include "graphics/view.i"
include "graphics/sprite.i"
include "graphics/copper.i"
include "graphics/gfxbase.i"
include "intuition/preferences.i"
include "intuition/screens.i"
include "exec/memory.i"
include "intuition/intuition.i"
include "libraries/dos.i"
list
* llen 80
bra clockdjstart
dc.b 'Clockdj V2.97'
cnop 0,2
clockdjstart
cmpi.b #10,(a0) any data
beq noparm no
move.b (a0),revswitch set reverse button switch
moveq #80,d0 maximum initial length
lea itext0,a1 Text for menu
lea newcli,a2 command area
lea 2(a0),a0 next field
moveq #0,d2
moveq #0,d3
newinit cmpi.b #10,(a0) end
beq noparm
newinit2
cmpi.b #10,(a0) end
beq clrend
tst.l d2
bne.s 3$
cmpi.b #8,d3 end?
beq.s 2$
cmpi.b #' ',(a0) end of initial command?
bne.s 1$
2$ not.l d2 set switch
bra 3$
1$ move.b (a0),(a1)+
3$ move.b (a0)+,(a2)+
addq.b #1,d3
dbra d0,newinit2
clrend
clr.b (a2) end of newcli
noparm
lea layersname,a1
MOVEQ #0,D0 ; load version number
MOVEA.L 4,A6 ; load exec library address
JSR OpenLibrary(A6) ; call OpenLibrary
TST.L D0 ok?
bne layok yes
rts
layok MOVE.L D0,layers save
lea dosname,A1
MOVEQ #0,D0 ; load version number
MOVEA.L 4,A6 ; load exec library address
JSR OpenLibrary(A6) ; call OpenLibrary
TST.L D0 ok?
bne 4$ yes
bra layerbye
4$ MOVE.L D0,a6 save
lea savefile,a0 name of save string
move.l a0,d1 move into right reg
move.l #MODE_OLDFILE,d2 old file
jsr Open(a6) Open
tst.l d0 file there?
beq.s closedos no use defaults
move.l d0,d1 file handle
move.l #diskbufferl,d4 length expected
lea diskbuffer,a4
readin
move.l a4,d2 data
move.l #1,d3 data length
move.l d1,-(a7) save handle
jsr Read(a6) read it in
move.l (a7)+,d1 restore file handle
tst.l d0 test result
beq closein eof
bmi closein error
adda #1,a4 next
dbra d4,readin
closein
jsr Close(a6) close file
closedos
MOVE.L a6,a1 dos Library
movea.l 4,a6 Exec base
jsr CloseLibrary(A6) call CloseLibrary
nofile
lea window,a0 new window structure
move.w windowleft,nw_LeftEdge(a0) restore
move.w windowtop,nw_TopEdge(a0) window
cmpi.b #memtot,memory total memory display?
beq.s 2$ yes
******* set up window for chip/fast memory display *********
lea itext1b,a1 new text
move.w #312,nw_Width(a0) set new width
lea sepmsg,a2 new message text
bra.s 3$
******** set up window for total memory display
2$ lea itext1,a1 new text
lea totmsg,a2 new message text
3$ move.l a1,memtext set up text
lea Date_Text,a0 message structure
move.l a2,it_IText(a0) set up message address
move.w colours,Date_Text restore colours
****** set up priority check mark ********
lea priindex,a0 index of fields
moveq #0,d0
move.b priority,d0 get priority
ext.w d0 extend sign
addq #3,d0 create
lsl.l #2,d0 index
movea.l 0(a0,d0),a1
ori.w #CHECKED,0(a1) set check mark
****** set up refresh check mark ********
cmpi.l #100000,refrate
bne.s not10
ori.w #CHECKED,ref1
bra blankcheck
not10 cmpi.l #200000,refrate
bne.s not20
ori.w #CHECKED,ref2
bra blankcheck
not20 cmpi.l #500000,refrate
bne.s not50
ori.w #CHECKED,ref3
bra blankcheck
not50 cmpi.l #999999,refrate
bne.s not10
ori.w #CHECKED,ref4
********* Set up blank check mark ********
blankcheck
cmpi.w #0,blanktime
bne.s notb0
ori.w #CHECKED,blach1
bra pointcheck
notb0 cmpi.w #5*60,blanktime
bne.s notb5
ori.w #CHECKED,blach2
bra pointcheck
notb5 cmpi.w #10*60,blanktime
bne.s notb10
ori.w #CHECKED,blach3
bra pointcheck
notb10 cmpi.w #20*60,blanktime
bne.s notb20
ori.w #CHECKED,blach4
bra pointcheck
notb20 cmpi.w #30*60,blanktime
bne.s notb30
ori.w #CHECKED,blach5
bra pointcheck
notb30 ori.w #CHECKED,blach6
********* Set up blank check mark ********
pointcheck
cmpi.w #0,pointtime
bne.s notp0
ori.w #CHECKED,poich1
bra speedset
notp0 cmpi.w #5,pointtime
bne.s notp5
ori.w #CHECKED,poich2
bra speedset
notp5 cmpi.w #10,pointtime
bne.s notp10
ori.w #CHECKED,poich3
bra speedset
notp10 cmpi.w #20,pointtime
bne.s notp20
ori.w #CHECKED,poich4
bra speedset
notp20 cmpi.w #30,pointtime
bne.s notp30
ori.w #CHECKED,poich5
bra speedset
notp30 ori.w #CHECKED,poich6
**** set mouse speed check mark
speedset
moveq #0,d0
move.b mousespeed,d0 get speed
lsl.l #2,d0 *4
lea mousecheck,a0 addreses
movea.l 0(a0,d0),a1 get address
ori.w #CHECKED,(a1) set check mark
****** set sun mouse check mark
tst.b sunswitch sun mouse on?
beq ftest no
ori.w #CHECKED,suncheck set tick
****** set window to front check mark
ftest tst.b wtfcount neg?
bmi fset0x yes
fcheckdo
moveq #0,d0
move.b wtfcount,d0 get speed
lsl.l #2,d0 *4
lea frontcheckr,a0 addreses
movea.l 0(a0,d0),a1 get address
ori.w #CHECKED,(a1) set check mark
bra btest
fset0x clr.b wtfcount
bra fcheckdo
****** set window to back check mark
btest tst.b backswitch sun mouse on?
bmi bset0x no
bcheckdo
moveq #0,d0
move.b wtbcount,d0 get speed
lsl.l #2,d0 *4
lea backcheckr,a0 addreses
movea.l 0(a0,d0),a1 get address
ori.w #CHECKED,(a1) set check mark
bra ctest
bset0x clr.b wtbcount
bra bcheckdo
****** set screen cycle check mark
ctest tst.b cycleswitch screen cycle on?
beq ktest no
ori.w #CHECKED,cyclecheck set tick
****** set key to front check mark
ktest tst.b keyswitch key to front on?
beq ptest no
ori.w #CHECKED,keycheck set tick
****** set pop to front check mark
ptest tst.b popswitch key to front on?
beq iopen no
ori.w #CHECKED,wtfcheck set tick
***** open intuition library and store its pointer *****
iopen LEA IntuitionName(PC),A1
MOVEQ #0,D0 ; load version number
MOVEA.L 4,A6 ; load exec library address
JSR OpenLibrary(A6) ; call OpenLibrary
TST.L D0
BNE.S *+4
RTS ; FAIL: couldn't open intuition library
MOVE.L D0,intuit ; store intuition library pointer
********* open window
lea window,a0
movea.l intuit,A6
JSR OpenWindow(A6) ; call OpenWindow
TST.L D0
BEQ.L FailOpenWindow
movea.l d0,a0
move.l wd_WLayer(a0),layer window layer
movea.l wd_WScreen(a0),a1 screen pointer
lea sc_LayerInfo(a1),a0 get Layer_info address
move.l a0,layerinfo save
****** set up menu strip
movea.l d0,a3 save window pointer
movea.l d0,a0
lea menu0,a1 menu structure
jsr SetMenuStrip(a6) set up menu
WindowOpened:
;============================================================================
; Initialise the intput handler structure.
;============================================================================
move.b #NT_INTERRUPT,inthandler+LN_TYPE set the node type
move.b #127,inthandler+LN_PRI I want to be first
move.l #datarea,inthandler+IS_DATA handler can see data
move.l #intcode,inthandler+IS_CODE point to code
;============================================================================
; get a signal bit for input handler
;============================================================================
movea.l 4,a6 using exec.library again
moveq.l #-1,d0 any signal will do
jsr AllocSignal(a6)
moveq.l #0,d1 convert signum to a mask
bset.l d0,d1
move.l d1,insig save
move.l d1,d7 stash sig bit
; get ClockWindow->UserPort->mp_SigBit into D0
MOVEA.L wd_UserPort(A3),A0 A0 = ClockWindow->UserPort
MOVEQ #0,D0
MOVE.B MP_SIGBIT(A0),D0 D0 = the ClockWindow's mp_SigBit
MOVEQ #1,D4
LSL.L D0,D4 ; D4 = windowSigs
or.l D4,D7 ; D7 = waitFlags
***** create timer port *****
movea.l 4,A6 load exec library address
; get a signal bit
MOVEQ #-1,D0
JSR AllocSignal(A6) ; call AllocSignal
MOVE.L D0,D3 ; D3 = sigBit
BMI FailCreateTimer1
* alloc sprite data
moveq #11*4,D0 size of structure
MOVE.L #MEMF_CLEAR+MEMF_CHIP,D1 memory type = CLEAR and CHIP
JSR AllocMem(A6) ; call AllocMem
MOVE.L D0,spriteblank
; alloc port structure
moveq #MP_SIZE,D0 size of structure
MOVE.L #MEMF_CLEAR+MEMF_PUBLIC,D1 memory type = CLEAR and PUBLIC
JSR AllocMem(A6) ; call AllocMem
MOVE.L D0,D5 ; D5 = timer Port
BNE.S SkipFailCode
; AllocMem failed
MOVE.L D3,D0
JSR FreeSignal(A6) ; call FreeSignal
BRA FailCreateTimer2
SkipFailCode:
; fill port fields
MOVEA.L D5,A2
ADDQ.L #LN_TYPE,A2 ; A2 now points to the LN_TYPE field
MOVE.W #NT_MSGPORT+LN_PRI,(A2)+ LN_TYPE = NT_MSGPORT, LN_PRI = 0
LEA TimerPortName(PC),A0
MOVE.L A0,(A2)+ ; LN_NAME = address of timer port name
MOVE.W D3,(A2)+ ; MP_FLAGS = (#PA_SIGNAL=0), MP_SIGBIT = sigBit
MOVEQ #0,D0
MOVEA.L D0,A1
JSR FindTask(A6) ; call FindTask ( 0 arg means this task)
MOVE.L D0,(A2) ; MP_SIGTASK = pointer to found task
move.l d0,task save task pointer
move.l d0,a1 my task
moveq #0,d0
move.b #50,d0 Priority 2
jsr SetTaskPri(a6) call SetTaskPri
** get input device port space
movea.l 4,a6 exec base
moveq #MP_SIZE,d0 size of structure
move.l #MEMF_CLEAR+MEMF_PUBLIC,d1 memory type = CLEAR and PUBLIC
jsr AllocMem(a6) call AllocMem
move.l d0,inputport save input Port
bne gotsp
moveq #8,d0
rts Big trouble. give up
** fill in port fields
gotsp movea.l inputport,a1
move.b #NT_MESSAGE,LN_TYPE(a1) LN_TYPE = NT_MESSAGE(5)
move.l #inputportname,LN_NAME(a1) name
* stick task in the msg port.
move.l task,MP_SIGTASK(a1) task pointer
BRA SkipFailSection
********** FAILURE SECTION ************
ClosedWindow:
* abort any standing timer request
movea.l 4,a6 exec base
MOVEA.L timer,A1 timer IORequest
ABORTIO
; close timer device
movea.l timer,A1 timer IORequest
JSR CloseDevice(A6) ; call CloseDevice
* Free timer request storage
movea.l timer,A1 timer IORequest
moveq #MP_SIZE,D0 size of structure
jsr FreeMem(A6) call FreeMem
FailOpenDevice:
FailTimeRequestAlloc:
; close timer port
MOVEA.L D5,A1
JSR RemPort(A6) ; call RemPort
MOVEA.L D5,A2
MOVEQ #-1,D6
MOVE.B D6,$A(A2)
MOVE.L D6,(A2)
MOVE.L (SP)+,D0 ; get the sigBit
JSR FreeSignal(A6) ; call FreeSignal
move.l insig,d0 input handler signal
JSR FreeSignal(A6) ; call FreeSignal
MOVEA.L D5,A1
MOVEQ #$22,D0
JSR FreeMem(A6) ; call FreeMem
FailCreateTimer2:
FailCreateTimer1:
MOVEA.L A3,A0
movea.l intuit,A6
jsr ClearMenuStrip(a6) remove menu
MOVEA.L A3,A0
JSR CloseWindow(A6) ; call CloseWindow
FailOpenWindow:
movea.l intuit,A1 Intuition Library
movea.l 4,a6 exec base
JSR CloseLibrary(A6) call CloseLibrary
;============================================================================
; remove intput handler
;============================================================================
movea.l 4,a6 using exec.library
lea inputreq,a1
move.l #inthandler,IO_DATA(a1)
move.l #IS_SIZE,IO_LENGTH(a1) set length
move.w #IND_REMHANDLER,IO_COMMAND(a1) remove handler
move.l 4,a6
jsr DoIO(a6)
lea inputreq,A1 input IORequest
JSR CloseDevice(A6) ; call CloseDevice
movea.l inputport,a1 Remove the input Port
jsr RemPort(a6)
movea.l inputport,a1 input port
moveq #MP_SIZE,D0 size of structure
jsr FreeMem(A6) call FreeMem
movea.l spriteblank,a1 input port
moveq #11*4,D0 size of structure
jsr FreeMem(A6) call FreeMem
layerbye MOVE.L layers,a1 layers
MOVEA.L 4,A6 ; load exec library address
JSR CloseLibrary(A6) call CloseLibrary
moveq #0,d0
rts
********* FAILURE END **********
SkipFailSection:
; add the ports
MOVEA.L D5,A1
movea.l 4,a6 Exec base
JSR AddPort(A6) ; call AddPort
move.l inputport,a1 Message Port
jsr AddPort(a6) Add another Port to list
** Set up input IOReq structures
lea inputreq,a1 IORequest
move.b #NT_MESSAGE,LN_TYPE(a1) LN_TYPE = NT_MESSAGE(5)
move.b #0,LN_PRI(a1) LN_PRI = 0
move.l inputport,MN_REPLYPORT(a1) move in message port pointer
** open input device
lea inputname,a0 device name
moveq #0,d0 unit number
lea inputreq,a1 IOReq
moveq #0,d1 flags
jsr OpenDevice(a6)
lea inputreq,a1 IOReq
cmpi.b #0,IO_ERROR(a1) ok?
beq.s openok yes
moveq #0,d0
move.b IO_ERROR(a1),d0
rts
openok
move.l #inthandler,IO_DATA(a1)
move.l #IS_SIZE,IO_LENGTH(a1) set length
move.w #IND_ADDHANDLER,IO_COMMAND(a1)
;============================================================================
; now that everything is initialised, add the input handler
;============================================================================
lea inputreq,a1
move.l 4,a6
jsr DoIO(a6)
***** use the timer port sigBit(D3) to set the timeOutSig(D6) *****
MOVE.L D3,D0
MOVE.L D3,-(SP) ; save the sigBit
MOVEQ #1,D6
LSL.L D0,D6
OR.L D6,D7 ; update the waitFlags
***** initialize timeRequest structure *****
MOVEQ #IOTV_SIZE,D0 D0 = IOTV_SIZE
MOVE.L #MEMF_CLEAR+MEMF_PUBLIC,D1 memory type = clear it, and public
JSR AllocMem(A6) ; call AllocMem
TST.L D0
BEQ FailTimeRequestAlloc
MOVEA.L D0,A5 ; A5 = timeRequest
move.l d0,timer save timer IORequest
move.b #NT_MESSAGE,LN_TYPE(A5) LN_TYPE = NT_MESSAGE(5)
move.b #0,LN_PRI(A5) LN_PRI = 0
MOVE.L D5,MN_REPLYPORT(A5) MN_REPLYPORT = timerPort
; AllocMem set to zero the IO_FLAGS, IO_ERROR fields
***** open vblank timer device *****
LEA TimerName(PC),A0 ; A0 = timer name
MOVEA.L A5,A1 ; A1 = timeRequest
MOVEQ #1,D0 ; D0 = UNIT_VBLANK(1)
MOVEQ #0,D1
JSR OpenDevice(A6) ; call OpenDevice
TST.L D0
BNE FailOpenDevice
MOVE.W #TR_ADDREQUEST,IO_COMMAND(A5) IO_COMMAND = TR_ADDREQUEST(9)
***** initialize main loop *****
LEA buffer(PC),A2 ; A2 = bufferPTR
LEA InitMainLoop(PC),A4
BRA InitializeTime
InitMainLoop:
LEA WhileMoreMessages(PC),A4
MainLoop:
MOVE.L D7,D0 ; D0 = waitFlags
movea.l 4,a6 Exec base
JSR Wait(A6) ; call Wait
move.l d0,d3 save
move.l insig,d1 sigbit for input device
and.l d0,d1 input signal
beq notinput not input device
** process input events
processinput
*** test for window expand
cmp.b #'e',action do delete window?
bne delwintest no
move.l #windowtabl/16-1,d0 entries
lea windowtab,a1 start of table
add.l #windowtabl-16,a1 end of table
wtab2 tst.l (a1) free?
bne gotlast yes
suba.l #16,a1 down 1
dbra d0,wtab2
bra notinput no more - ignore
gotlast
movem.l a2-a5/d2-d7,-(sp)
move.l intuit,a6 intuition base
move.l (a1),a0 window
move.l ib_ActiveScreen(a6),d1 get active screen
move.l #windowtab,d2 start of table
move.l #windowtabl/16-1,d0 entries
slook cmp.l 4(a1),d1 same screen?
beq gotwscreen yes
suba.l #16,a1 next entry
cmp a1,d2 at start?
bne slook
movem.l (sp)+,a2-a5/d2-d7
bra notinput
gotwscreen
*** look for window
move.l d1,a0
move.l sc_FirstWindow(a0),a2 get first window
move.l a2,d2
nextlwin2
move.l d2,a2
cmp.l 0(a1),d2 right one?
beq gotewind yes
move.l wd_NextWindow(a2),d2 get next window
beq weend no more
bra nextlwin2
gotewind
moveq #0,d0
moveq #0,d1
move.l (a1),a0
move.w 12(a1),d0 x position
move.w 14(a1),d1 y position
move.l a1,-(sp)
jsr MoveWindow(a6)
move.l (sp)+,a1
move.l (a1),a0 window
moveq #0,d0
moveq #0,d1
move.w 8(a1),d0 x amount
move.w 10(a1),d1 y amount
subq #1,d0
subq #1,d1
move.l a1,-(sp) delete entry
jsr SizeWindow(a6) like a rabbit out of a hat
move.l (sp)+,a1
weend move.l a1,d0
sub.l #windowtab,d0
move.l #windowtabl,d1
sub.l d0,d1 get move length
sub.l #16,d1
divu #4,d1 in long words
ext.l d1
subq #1,d1
lea (a1),a2 to address
lea 16(a1),a3 from address
clearentry
move.l (a3)+,(a2)+
dbra d1,clearentry
movem.l (sp)+,a2-a5/d2-d7
bra notinput
*** test for window shrink
delwintest
cmp.b #'d',action do delete window?
bne newclitst no
* get next available slot
lea windowtab,a1 start of table
move.l #windowtabl/16-1,d0 entries
wtab tst.l (a1) free?
beq gotwspace yes
adda.l #16,a1 next entry
dbra d0,wtab
bra notinput no space - ignore
gotwspace
move.l a1,-(sp)
bsr windowpointer find where pointer is
move.l (sp)+,a1
tst.l d0 got window?
beq notinput no
move.l d0,a0
tst.l wd_UserPort(a0)
bne.s 1$
tst.l wd_WindowPort(a0)
beq notinput
1$ move.l d0,(a1) save window pointer
moveq #0,d0
moveq #0,d1
move.l wd_WScreen(a0),4(a1) save screen
move.w wd_Width(a0),d0 width
move.w wd_Height(a0),d1 height
move.w wd_Width(a0),8(a1) width
move.w wd_Height(a0),10(a1) height
move.w wd_LeftEdge(a0),12(a1) x position
move.w wd_TopEdge(a0),14(a1) y position
move.l intuit,a6 intuition base
subq #1,d0
subq #1,d1
neg.l d0
neg.l d1
move.l a0,-(sp)
jsr SizeWindow(a6) vapourize
move.l (sp)+,a0
move.q #0,d0
moveq #0,d1
move.w wd_LeftEdge(a0),d0 x position
move.w wd_TopEdge(a0),d1 y position
neg.l d0
neg.l d1
jsr MoveWindow(a6)
bra notinput
*** test for newcli
newclitst
cmp.b #'n',action do newcli?
bne.s sunact no
move.l wd_WScreen(a3),a0 screen pointer
move.l intuit,a6
move.l ib_ActiveScreen(a6),d0 get active screen
cmp.l a0,d0 is my screen the active one?
beq donewcli yes
jsr ScreenToFront(a6)
bra donewcli
sunact cmp.b #'f',action flip windows?
bne winflip
bsr windowpointer find where pointer is
tst.l d0 got window?
beq notinput no
move.l intuit,a6
cmp.l ib_ActiveWindow(a6),d0 active window?
beq notinput yes
move.l a0,-(sp)
move.l d0,a0 activate this window
jsr ActivateWindow(a6) activate the window
movea.l (sp)+,a0
bra notinput
winflip
move.l intuit,a6 get intuition base
cmp.b #'w',action window to back?
bne flipscreen no
wtoback
lea pause,a1 new ioreq
move.l a5,a0 old ioreq
moveq #IOTV_SIZE/4-1,d0
copyreqw
move.l (a0)+,(a1)+
dbra d0,copyreqw
lea pause,a1
MOVE.W #TR_ADDREQUEST,IO_COMMAND(A1) IO_COMMAND = TR_ADDREQUEST(9)
MOVE.l #0,IO_SIZE+TV_SECS(A1) TV_SECS = $01(01 seconds) ||dj
MOVE.L #10000,IO_SIZE+TV_MICRO(A1) TV_MICRO= 10 ms
movea.l 4,a6 set Exec base
JSR DoIO(A6) wait
bsr windowpointer find where pointer is
tst.l d0 got window?
beq SetAndPrintTime no
move.l d0,a0 get window
cmp.l backwin,d0 same window?
bne clrswb no
move.l wtbsecsnew,d0 get seconds
sub.l wtbsecs,d0 minus old secs
beq addoneb increase count
cmpi.l #1,d0 one second difference?
bhi clrswb more
move.l wtbsecsnew+4,d0 get micros
sub.l wtbsecs+4,d0 minus old micros
bmi addoneb
beq addoneb
clrswb clr.b backswitch set count to 0
move.l a0,backwin save window
move.l wtbsecsnew,wtbsecs save
move.l wtbsecsnew+4,wtbsecs+4 save micros
addoneb add.b #1,backswitch
moveq #0,d0 clear
move.b wtbcount,d0 get count
cmp.b backswitch,d0
bne SetAndPrintTime no
clr.b backswitch
clr.l wtbsecs
clr.l wtbsecs+4
clr.b frontswitch
move.l wd_Flags(a0),d0 get window flags
andi.l #BACKDROP,d0 backdrop window?
bne SetAndPrintTime yes - no window to back
movea.l intuit,a6 layers base
jsr WindowToBack(a6)
bra SetAndPrintTime
*** Subroutine to find which window the pointer is in
windowpointer
movea.l intuit,a6 get intuition base
movea.l ib_FirstScreen(a6),a1 get first screen
move.l ib_ActiveScreen(a6),d0 get Active screen
cmp.l a1,d0 top screen active one?
bne winret0 no - don't look for layer
moveq #0,d0
moveq #0,d1
move.l layers,a6 get layers library
lea sc_LayerInfo(a1),a0 get layer info
move.l a0,-(sp)
jsr LockLayerInfo(a6) lock the layer info
move.w sc_MouseX(a1),d0 get X pointer
move.w sc_MouseY(a1),d1 get Y pointer
move.l (sp),a0 get pointer back
jsr WhichLayer(a6) find active layer
move.l (sp)+,a0 get pointer back
move.l d0,-(sp) save result
jsr UnlockLayerInfo(a6)
move.l (sp)+,d0
tst.l d0 get one?
bne findwin yes
rts
findwin
movea.l intuit,a6 get intuition base
movea.l ib_ActiveScreen(a6),a0 get active screen
move.l sc_FirstWindow(a0),a1 get first window
nextlwin
cmp.l wd_WLayer(a1),d0 right one?
beq inwind yes
move.l wd_NextWindow(a1),d1 get next window
beq.s winret0 no more
movea.l d1,a1
bra nextlwin
winret0
moveq #0,d0
rts
inwind
move.l d0,d1 return layer in d1
move.l a1,d0
rts
flipscreen
lea pause,a1 new ioreq
move.l a5,a0 old ioreq
moveq #IOTV_SIZE/4-1,d0
copyreq move.l (a0)+,(a1)+
dbra d0,copyreq
lea pause,a1
MOVE.W #TR_ADDREQUEST,IO_COMMAND(A1) IO_COMMAND = TR_ADDREQUEST(9)
MOVE.l #0,IO_SIZE+TV_SECS(A1) TV_SECS = $01(01 seconds) ||dj
MOVE.L #10000,IO_SIZE+TV_MICRO(A1) TV_MICRO= 10 ms
movea.l 4,a6 set Exec base
JSR DoIO(A6) wait
movea.l intuit,a6
moveq #0,d0
jsr LockIBase(a6)
move.l d0,-(sp)
move.l ib_FirstScreen(a6),a0 get first screen
getnextscreen
move.l sc_NextScreen(a0),d0 get next screen
beq.s gotlastscreen
move.l d0,a0
bra getnextscreen
gotlastscreen
movea.l a0,a2 keep
movea.l (sp)+,a0 get lock
jsr UnlockIBase(a6)
movea.l a2,a0
jsr ScreenToFront(a6)
movea.l a2,a1 active screen
move.l sc_FirstWindow(a1),d0 get screen
beq SetAndPrintTime no window
move.l d0,a0
jsr ActivateWindow(a6) activate 1st window
bra SetAndPrintTime
notinput move.l d3,d0 restore
AND.L D6,D0 ; was it the timeoutSig(D6)?
BEQ.S isItAWindowSig ; if it wasn't branch
BRA SetAndPrintTime
isItAWindowSig:
AND.L D4,D3 ; was what woke the Wait up a windowSig(D4)?
BEQ MainLoop ; if not restart the main loop
; keep doing the loop While there are window messages
WhileMoreMessages:
movea.l 4,a6 set to Exec base
MOVEA.L wd_UserPort(A3),A0 A0 = window's UserPort
JSR GetMsg(A6) ; call GetMsg
TST.L D0 ; D0 = message
BEQ SetAndPrintTime ; no more messages so see if any timer messages
MOVEA.L D0,A1
move.l im_Class(a1),class save class
move.w im_Code(a1),code1 save code
JSR ReplyMsg(A6) call ReplyMessage
cmpi.l #MENUPICK,class menu?
bne refres no
bsr menuscan do changes
cmpi.w #MENUNULL,code1 item picked?
beq refres no
moveq #0,d0 clear
move.w code1,d0 get code
andi.w #$7ff,d0 get item and menu numbers
lsr #5,d0 remove menu number
cmpi.w #0,d0 item 0?
beq donewcli yes - open cli
cmpi.w #15,d0 quit?
beq ClosedWindow yes
cmpi.w #2,d0 colour?
bne.s tchip no
moveq #0,d0 clear
move.w code1,d0 get code again
lsr #8,d0 get
lsr #3,d0 subcode
cmpi.w #11,d0 got one?
bhi refres no
lea newcol,a0 new colours
lsl #1,d0 * 2
move.w 0(a0,d0.w),Date_Text set new colours
move.w 0(a0,d0.w),colours save for save
bra refres
tchip cmpi.w #1,d0 change memory display?
bne chpri no
***** swap memory display *************
eor.b #1,memory set to opposite
movea.l A3,A0 window
movea.l intuit,A6
jsr ClearMenuStrip(a6) remove menu
lea window,a1
cmpi.b #memtot,memory total memory display?
beq.s 1$ yes
******* set up window for chip/fast memory display *********
lea sepmsg,a2 new message text
move.l #itext1b,memtext new text
move.l #(312-184),d2 set new width
move.l #-128,d0 move it
cmpi.w #128,wd_LeftEdge(a3) neg?
bcs 3$ yes
bra.s 2$
3$ moveq #0,d0
2$ MOVEA.L A3,A0
moveq #0,d1 Dy
JSR MoveWindow(A6) Move
movea.l a3,a0
move.l d2,d0 Dx
moveq #0,d1 Dy
JSR SizeWindow(A6) alter size
bra setmen
******** set up window for total memory display
1$ moveq #0,d0
moveq #0,d1
move.l #itext1,memtext new text
move.l #(184-312),d0 set new width - dx
lea totmsg,a2 new message text
movea.l a3,a0
moveq #0,d1 Dy
JSR SizeWindow(A6) alter size
MOVEA.L A3,A0
move.l #128,d0 Dx value
moveq #0,d1 Dy
JSR MoveWindow(A6) Move
setmen lea Date_Text,a0 message structure
move.l a2,it_IText(a0) set up message address
movea.l a3,a0
lea menu0,a1 menu structure
jsr SetMenuStrip(a6) attach menu
bra refres
chpri
testref
testblank
testpoint
testmouse
testsun
testclickf
testcycle
********* save routine
testsave cmpi.w #14,d0 save?
beq dosave
cmpi.w #14,d0 valid?
bls WhileMoreMessages yes
move.b #1,owsw
MOVEA.L wd_RPort(A3),A0 window's RPort
LEA ouch,A1 silly message structure
MOVEQ #0,D0
MOVEQ #0,D1
movea.l intuit,A6
JSR PrintIText(A6) ; call PrintIText
bra WhileMoreMessages
dosave
moveq #0,d0
move.w #CHECKED,d0
and.w suncheck,d0 do sun mouse?
beq clrsun no
move.b #$ff,sunswitch
bra cyccheck
clrsun
clr.b sunswitch
cyccheck
move.w #CHECKED,d0
and.w cyclecheck,d0 do sun mouse?
beq clrcycle no
move.b #$ff,cycleswitch
bra keych
clrcycle
clr.b cycleswitch
keych
move.w #CHECKED,d0
and.w keycheck,d0 do sun mouse?
beq clrkey no
move.b #$ff,keyswitch
bra popch
clrkey
clr.b keyswitch
popch
move.w #CHECKED,d0
and.w wtfcheck,d0 do sun mouse?
beq clrpop no
move.b #$ff,popswitch
bra dowrite
clrpop
clr.b popswitch
dowrite
LEA dosname,A1
MOVEQ #0,D0 ; load version number
MOVEA.L 4,A6 ; load exec library address
JSR OpenLibrary(A6) ; call OpenLibrary
TST.L D0 ok?
beq refres no
MOVE.L D0,a6 save
lea savefile,a0 name of save string
move.l a0,d1 move into right reg
move.l #MODE_OLDFILE,d2 old file
jsr Open(a6) Open
tst.l d0 file there?
bne.s 1$ yes, got file handle
lea savefile,a0 name of save string
move.l a0,d1 move into right reg
move.l #MODE_NEWFILE,d2 new file
jsr Open(a6) Open
tst.l d0 got one ?
beq refres no
1$ move.l d3,-(a7) save d3
move.w wd_LeftEdge(a3),windowleft set up window position
move.w wd_TopEdge(a3),windowtop "
lea diskbuffer,a0
move.l a0,d2 data
move.l #diskbufferl,d3 data length
move.l d0,d1 file handle
move.l d0,-(a7) save file handle
jsr Write(a6) write it out
move.l (a7)+,d1 restore file handle
jsr Close(a6) close file
MOVE.L a6,a1 dos Library
movea.l 4,a6 Exec base
jsr CloseLibrary(A6) call CloseLibrary
move.l (a7)+,d3 restore d3
bra refres carry on
************** do newcli
************** Open dos library
donewcli LEA dosname,A1
MOVEQ #0,D0 ; load version number
MOVEA.L 4,A6 ; load exec library address
JSR OpenLibrary(A6) ; call OpenLibrary
TST.L D0 ok?
beq.s refres no
MOVE.L D0,a6 save
move.l d3,-(a7) save d3
lea nilname,a0 name of nil string
move.l a0,d1 move into right reg
move.l #MODE_NEWFILE,d2 new file
jsr Open(a6) Open
move.l d0,d3 save out handle
moveq #0,d2 input handle
lea newcli,a0 newcli command string
move.l a0,d1
jsr Execute(a6) Execute
move.l (a7)+,d3 restore d3
* close dos library
MOVE.L a6,a1 dos Library
movea.l 4,a6 Exec base
jsr CloseLibrary(A6) call CloseLibrary
bra SetAndPrintTime get timer events
refres move.b #0,oldsecs force refresh
************************************
PrintTime:
tst.b owsw ouch?
beq noow no
clr.b owsw off
bra treturn
noow tst.l tswitch do display
beq treturn no
cmpi.b #memtot,memory total memory?
beq.s 2$ yes
lea buffer2+8,a0 seconds
bra.s 3$
2$ lea buffer+8,a0 seconds
3$ move.b oldsecs,d1
move.l a0,-(sp) keep a0
cmp.b (a0),d1 do display?
beq nodisable no
tst.w blanktime off?
beq tespoint yes
tst.b blankdone already blank?
bne tespoint yes
move.w blanktimer,d0
cmp.w blanktime,d0 time to blank?
bcs add1blank no
lea newscreen,a0
move.l intuit,a6
jsr OpenScreen(a6)
move.l d0,blankscreen keep
beq showtime didn't work
lea graphicsname,a1
MOVEQ #0,D0 ; load version number
MOVEA.L 4,A6 ; load exec library address
JSR OpenLibrary(A6) ; call OpenLibrary
TST.L D0 ok?
beq showtime yes
move.l d0,a6 graphics base
move.l blankscreen,a1 get screen
lea sc_ViewPort(a1),a0 get viewport
move.l d2,-(sp)
moveq #0,d1 R
moveq #0,d2 G
moveq #0,d3 B
moveq #0,d0 Register
jsr SetRGB4(a6) nice black for CL
movea.l a6,A1 graphics Library
movea.l 4,a6 exec base
JSR CloseLibrary(A6) call CloseLibrary
move.l (sp)+,d2
not.b blankdone set to blanked
* move.w #$0020,$dff000+$96 turn off sprite dma
tst.w pointtime pointer blank on?
bne showtime yes
bra killpoint
add1blank
addq.w #1,blanktimer add 1
tespoint
tst.w pointtime off?
beq showtime yes
move.w pointtimer,d0
cmp.w pointtime,d0 time to blank?
bcs add1point no
killpoint
lea graphicsname,a1
MOVEQ #0,D0 ; load version number
MOVEA.L 4,A6 ; load exec library address
JSR OpenLibrary(A6) ; call OpenLibrary
tst.l d0
beq showtime yes
move.l d0,a6 ok?
move.l gb_copinit(a6),a0 copper start-up
lea copinit_sprstrtup(a0),a1 sprite data
clrsprite
tst.b pointdone pointer blank already?
bne checkpoint yes
not.b pointdone set switch
redopointer
moveq #0,d0
move.w 2(a1),spritesave high bytes
move.w 6(a1),spritesave+2 get rest of address
move.w spriteblank,2(a1) top
move.w spriteblank+2,6(a1) bottom
movea.l a6,A1 graphics Library
movea.l 4,a6 exec base
JSR CloseLibrary(A6) call CloseLibrary
* move.w #$0020,$dff000+$96 turn off sprite dma
bra showtime
checkpoint
move.w 2(a1),d1 high bytes
swap d1
move.w 6(a1),d1 get rest of address
cmp.l spriteblank,d1 still my blank pointer?
bne redopointer
bra showtime
add1point
addq.w #1,pointtimer
bra showtime
nodisable
move.l (sp)+,a0
cmpi.b #memtot,memory total memory?
beq.s totmem yes
move.l oldchip,d0
cmp.l chipavail,d0 do display?
bne.s showtime2 yes
move.l oldfast,d0
cmp.l fastavail+1,d0 do display?
beq treturn no
bra.s showtime2 do print
totmem move.l oldmem,d0
cmp.l avail+1,d0 do display?
beq treturn no, return
bra.s showtime2
showtime
move.l (sp)+,a0
showtime2
move.b (a0),oldsecs
move.l avail+1,oldmem
move.l chipavail,oldchip save for next test
move.l fastavail+1,oldfast save for next test
MOVEA.L wd_RPort(A3),A0 window's RPort
LEA Date_Text(PC),A1 Date_Text structure
MOVEQ #0,D0
MOVEQ #0,D1
movea.l intuit,A6
JSR PrintIText(A6) ; call PrintIText
moveq #0,d0
move.w newminutes,d0
cmp.w oldminutes,d0 do popup?
beq.s nopop no
move.w #CHECKED,d0
and.w wtfcheck,d0 do popup?
beq nopop no
move.w newminutes,oldminutes
movea.l layers,a6 layers base
movea.l layerinfo,a0 screen's layer info
movea.l layer,a1 window's layer
jsr UpfrontLayer(a6) pop
nopop:
treturn:
JMP (A4) ; normally jumps to WhileMoreMessages
*****************************
SetAndPrintTime:
MOVEA.L D5,A0 ; get message form timer port
movea.l 4,a6 set Exec base
JSR GetMsg(A6) ; call GetMsg
TST.L D0 ; D0 = message
BEQ MainLoop ; no more messages so start Waiting
InitializeTime:
************** initialize the buffer
cmpi.b #memtot,memory display total memory?
beq.s 1$ yes
lea buffer2+1,a2
jsr timeclear clear buffer
bra.s 2$
1$ lea buffer+1,a2 start of area to clear
jsr timeclear clear buffer
; set the timeRequest to wait for refresh time
2$ MOVE.l #0,IO_SIZE+TV_SECS(A5) TV_SECS = $01(01 seconds) ||dj
MOVE.L refrate,IO_SIZE+TV_MICRO(A5) TV_MICRO= 200 ms
; get the current time. It will be on the stack
SUBQ.L #4,A7
LEA (A7),A1 ; address of micros
SUBQ.L #4,A7
LEA (A7),A0 ; address of seconds
movea.l intuit,A6
JSR CurrentTime(A6) ; call CurrentTime
MOVE.L (A7)+,D0 ; secs
MOVE.L (A7)+,D1 ; micros
move.l d0,tswitch save because of mach11
CLR.W -(A7) ; push a zero word onto the stack => AM
DIVU #-$5740,D0 ; secs/#secs_in_12hrs
LSR.B #1,D0 ; test least sig. bit by shifting into C bit
BCC.S AM
; it is PM
MOVE.W #$C,(A7) ; top of stack now 12 => PM
AM:
SWAP D0 ;"n lower half of D0 = #of secs in the half day
MOVE.L D0,D1 ; save D0 into D1
MOVEQ #0,D0
MOVE.W D1,D0 ;
DIVU #$3C,D0 ; #of_secs_in_half_day/60
MOVE.W D0,-(A7) ; save the #of minutes*hrs in the half day
SWAP D0 ; D0.W = # of secs in the minute
move.w d0,seconds save seconds ||dj
******** start the timer running
MOVEA.L A5,A1
movea.l 4,a6 set Exec base
JSR SendIO(A6) ; call SendIO
*************** Find out available memory
move.l #1,d1 memory type = PUBLIC
jsr AvailMem(A6) ; call AvailMem
move.l d0,totalmemory save all memory
move.l #2,d1 memory type = PUBLIC
jsr AvailMem(A6) ; call AvailMem
move.l d0,chipmemory save all memory
******* reformat memory
cmpi.b #memtot,memory total memory?
bne.s 1$ no
lea avail+1,a2 memory display area
move.l totalmemory,d0 move in total memory
jsr formatmem format memory d isplay
bra.s 2$
1$ move.l chipmemory,d0 move in chip memory
lea chipavail,a2
jsr formatmem format memory display
move.l totalmemory,d0 get total
sub.l chipmemory,d0 get fast memory
lea fastavail+1,a2 fast memory
jsr formatmem
****** figure out what time it is and load it in the buffer
2$ cmpi.b #memtot,memory total memopry?
bne.s 3$ no
lea buffer,a2
bra.s 4$
3$ lea buffer2,a2
4$ move.w seconds,d1 get seconds
ext.l d1
divu #$a,d1 rem = ones digit; quot = tens ||dj
add.b d1,7(a2) put in 10s seconds ||dj
swap d1 get remainder ||
add.b d1,8(a2) put in ones seconds ||
MOVEQ #0,D0
MOVE.W (A7)+,D0 ; D0 has # of minutes*hrs in half day
DIVU #$3C,D0 ; divide it by 60; rem = minutes, quot = hrs
MOVEQ #0,D1
MOVE.W (A7)+,D1 ; D1 = (0=AM), (12=PM)
ADD.W D0,D1 ; add quot to D1 giving # of hrs in the day
SWAP D0 ; get the rem = minutes
move.w d0,newminutes save for popup ||dj
EXT.L D0
DIVU #$A,D0 ; divide by 10; rem = ones digit, quot = tens digit
ADD.B D0,4(A2) ; add tens digit to buffer[4]
SWAP D0
ADD.B D0,5(A2) add ones digit to buffer[5]
cmpi.w #12,d1 is it pm?
bgt movepm yes
blt moveam
move.b #'P',ampm1 set to pm since it's 12
move.b #'P',ampm2 set to pm since it's 12
bra.s dohours
moveam move.b #'A',ampm1 set to am
move.b #'A',ampm2 set to am
bra.s dohours
movepm move.b #'P',ampm1 set to pm
move.b #'P',ampm2 set to pm
subi.w #12,d1 make it < 12
dohours DIVU #$A,D1 divide hours by 10; rem = ones digit, quot = tens digit
ADD.B D1,1(A2) add tens digit to buffer[1]
SWAP D1
ADD.B D1,2(A2) add ones digit to buffer[2]
cmpi.b #'0',1(a2) 1st digit zero?
bne.s 1$ no - carry on
cmpi.b #'0',2(a2) 2nd digit zero?
bne.s 2$ no
move.b #'1',1(a2) set to 12 am
move.b #'2',2(a2) "
bra.s 1$
2$ move.b #' ',1(a2) blank 1st digit
1$ BRA.L PrintTime ; PrintTime will return
*********************************************************
* *
* Input handler *
* *
*********************************************************
intcode movem.l a0-a6/d1-d7,-(A7) save
nextevent
cmp.b #IECLASS_TIMER,ie_Class(a0) ignore timer
beq intdone
bra noinsave
* save to inspect
move.l #ie_SIZEOF/4-1,d0
lea event,a1
mevent move.l (a0)+,(a1)+ move
dbra d0,mevent
noinsave
cmp.b #IECLASS_RAWKEY,ie_Class(a0) got a key?
bne notkey
cmpi.w #$64,ie_Code(a0) is it L-alt?
bne laltup no
cmpi.w #IEQUALIFIER_RELATIVEMOUSE+IEQUALIFIER_LCOMMAND,ie_Qualifier(a0)
beq seti
tst.b lamiga L-A down?
beq setlalt no
seti
move.b #$ff,lsw set switch left
setlalt
move.b #$ff,lalt yes
bra blanktests
laltup
cmpi.w #$64+IECODE_UP_PREFIX,ie_Code(a0) L-alt-up?
bne latest no
move.b #0,lalt reset
move.b #0,lsw reset
bra blanktests
latest
cmpi.w #$66,ie_Code(a0) is it L-A?
bne amiup no
move.b #$ff,lamiga set
tst.b lalt L-alt down?
beq blanktests no
move.b #$ff,lsw set switch
amiup
cmpi.w #$66+IECODE_UP_PREFIX,ie_Code(a0) L-ami-up?
bne mtest no
clr.b lamiga
mtest
cmpi.w #$37,ie_Code(a0) is it m?
bne testesc no
cmpi.w #IEQUALIFIER_RELATIVEMOUSE+IEQUALIFIER_LCOMMAND,ie_Qualifier(a0)
bne testkeysw
moveq #0,d0
move.w #CHECKED,d0
and.w cyclecheck,d0 do screen cycle?
beq testkeysw no
move.b #IECLASS_NULL,ie_Class(a0) remove the m
bra doscreen
testesc
cmpi.w #$45,ie_Code(a0) is it ESC?
bne testkeysw no
cmpi.w #IEQUALIFIER_RELATIVEMOUSE+IEQUALIFIER_LCOMMAND,ie_Qualifier(a0)
bne testkeysw
move.b #'n',action set action to newcli
move.b #IECLASS_NULL,ie_Class(a0) remove
bra signaltask
testkeysw
moveq #0,d0
move.w #CHECKED,d0
and.w keycheck,d0 do key to front?
beq blanktests nope
tst.b lsw got icon?
bne blanktests maybe
cmpi.b #'l',mouseleft left down ?
beq blanktests yes don't do activate to avoid
* freeze when icon is picked up
move.l a0,-(sp)
bsr windowpointer find where pointer is
move.l d0,a0 window
move.l intuit,a6
movea.l ib_ActiveWindow(a6),a1 get active window
cmp.l a1,d0 already active?
beq resa0 yes
jsr ActivateWindow(a6)
resa0 move.l (sp)+,a0
bra blanktests
notkey
cmp.b #IECLASS_RAWMOUSE,ie_Class(a0) mouse event?
bne blanktests no
moveq #0,d0
move.w #CHECKED,d0
and.w suncheck,d0 do sun mouse?
beq speedtest no
cmpi.w #IECODE_NOBUTTON,ie_Code(a0) mouse button pressed?
bne speedtest yes
cmpi.b #'l',mouseleft left down ?
beq speedtest yes
move.b #'f',action set up for sun mouse cycle
move.l insig,d0 we want to send this signal
movea.l task,a1 to this task
move.l 4,a6 exec base
move.l a0,-(sp) save
jsr Signal(a6) so it wakes up
movea.l (sp)+,a0 restore
speedtest
move.l intuit,a6 get intuition base
move.l ib_ActiveScreen(a6),a1 get Active screen
cmpi.w #9,sc_MouseY(a1) is Y pointer in menu area?
bhi notmen no
cmpi.b #'r',mouseright right mouse button down?
bne notmen no
move.b #$ff,menuswitch set menuswitch
notmen
moveq #0,d0
tst.b mousespeed no acceleration?
beq buttontest no
moveq #0,d1
move.b mousespeed,d1 get mouse speed
add.w #4,d1 get multiplyer
moveq #0,d0
move.w ie_X(a0),d0 get value
incx cmp.w #1,d0 is it 1
beq.s doynow yes - leave it alone
cmp.w #-1,d0 is it 1
beq.s doynow yes - leave it alone
muls d1,d0 calculate new relative mouse
divs #4,d0
move.w d0,ie_X(a0) put back
doynow moveq #0,d0
move.w ie_Y(a0),d0 get value
incy cmp.w #1,d0 is it 1?
beq.s buttontest yes - leave it alone
cmp.w #-1,d0 is it 1?
beq.s buttontest yes - leave it alone
muls d1,d0
divs #4,d0
move.w d0,ie_Y(a0) put back
buttontest
cmpi.w #IECODE_LBUTTON,ie_Code(a0) left mouse button?
bne testright no
*
* code for window shrink
*
tst.b lamiga L-A down?
beq 1$ no
move.b #'d',action delete window
move.b #IECLASS_NULL,ie_Class(a0) remove l button
bra signaltask
1$
cmp.b #'r',mouseright r set?
beq wsig yes
move.b #'l',mouseleft yes - set state
*** do window to front here to avoid lockup
tst.b lsw got icon?
bne blanktests maybe
dowtf bsr wtofront
bra blanktests
wtofront
movem.l a0/a1/a2/a6,-(sp)
move.l a0,-(sp)
bsr windowpointer find where pointer is
move.l (sp)+,a0
tst.l d0 got window?
beq wtfend no
movea.l intuit,a6 get intuition base
move.l d0,a2 get window
cmp.l frontwin,d0 same window
bne clrsw no
move.l ie_TimeStamp(a0),d0 get seconds
sub.l wtfsecs,d0 minus old secs
beq addone increase count
cmpi.l #1,d0 one second difference?
bhi clrsw more
move.l ie_TimeStamp+4(a0),d0 get micros
sub.l wtfsecs+4,d0 minus old micros
bmi addone
beq addone
clrsw clr.b frontswitch set count to 0
move.l a2,frontwin save window
move.l ie_TimeStamp(a0),wtfsecs save
move.l ie_TimeStamp+4(a0),wtfsecs+4 save micros
addone add.b #1,frontswitch
moveq #0,d0 clear
move.b wtfcount,d0 get count
cmp.b frontswitch,d0
bne wtfend no
clr.b frontswitch
clr.l wtfsecs
clr.l wtfsecs+4
movea.l ib_ActiveScreen(a6),a0 get active screen
lea sc_LayerInfo(a0),a1 get layer info
cmp.l li_top_layer(a1),d1 already on top layer?
beq wtfend yes
movea.l a2,a0 get window
move.l wd_Flags(a0),d0 get window flags
andi.l #BACKDROP,d0 backdrop window?
bne wtfend yes - no window to front
jsr WindowToFront(a6) bring it to the front
wtfend movem.l (sp)+,a0/a1/a2/a6
rts
wsig
cmpi.b #'r',revswitch reverse buttons?
beq.s dowtb yes
moveq #0,d0
move.w #CHECKED,d0
and.w cyclecheck,d0 do screencycle?
beq blanktests no
tst.b lsw got icon?
bne blanktests maybe
tst.b menuswitch got a menu perhaps
bne blanktests don't do screen cycle
move.b #'s',action set action indicator
move.w #IECODE_RBUTTON+IECODE_UP_PREFIX,ie_Code(a0) alter to r up
* signal code
move.l insig,d0 we want to send this signal
movea.l task,a1 to this task
move.l 4,a6 exec base
move.l a0,-(sp) save
jsr Signal(a6) so it wakes up
movea.l (sp)+,a0 restore
bra blanktests
dowtb
move.l ie_TimeStamp(a0),wtbsecsnew save
move.l ie_TimeStamp+4(a0),wtbsecsnew+4 save micros
tst.b lsw got icon?
bne blanktests maybe
move.b #'w',action set up for window cycle
move.w #IECODE_RBUTTON+IECODE_UP_PREFIX,ie_Code(a0) alter to r up
signaltask
move.l insig,d0 we want to send this signal
movea.l task,a1 to this task
move.l 4,a6 exec base
move.l a0,-(sp) save
jsr Signal(a6) so it wakes up
movea.l (sp)+,a0 restore
bra blanktests
testright
cmpi.b #'l',mouseleft left down already?
bne testrightdown no
cmpi.w #IECODE_RBUTTON,ie_Code(a0) right mouse button
bne testleftup no
move.w #IECODE_LBUTTON+IECODE_UP_PREFIX,ie_Code(a0) change to l up
move.b #'r',mouseright set state
cmpi.b #'r',revswitch reverse buttons?
beq doscreen yes
move.b #'w',action set up for window to back
move.l ie_TimeStamp(a0),wtbsecsnew save
move.l ie_TimeStamp+4(a0),wtbsecsnew+4 save micros
bra signaltask
doscreen
moveq #0,d0
move.w #CHECKED,d0
and.w cyclecheck,d0 do screen?
beq blanktests no
tst.b lsw got icon?
bne blanktests maybe
tst.b pointdone pointer off?
beq sigscreen no
bsr hellopoint get pointer back
sigscreen
tst.b lsw got icon?
bne blanktests maybe
tst.b menuswitch got a menu perhaps
bne blanktests don't do screen cycle
move.b #'s',action set action indicator
* signal code
move.l insig,d0 we want to send this signal
movea.l task,a1 to this task
move.l 4,a6 exec base
move.l a0,-(sp) save
jsr Signal(a6) so it wakes up
movea.l (sp)+,a0 restore
bra blanktests
testleftup
cmpi.w #IECODE_LBUTTON+IECODE_UP_PREFIX,ie_Code(a0) l up?
bne testrightup no
move.b #0,mouseleft reset
bra blanktests
testrightdown
cmpi.w #IECODE_RBUTTON,ie_Code(a0) right mouse button?
bne testrupnol no
*
* code for window expand
*
tst.b lamiga L-A down?
beq 1$ no
move.b #'e',action delete window
move.b #IECLASS_NULL,ie_Class(a0) remove r button
bra signaltask
1$
move.b #'r',mouseright set r
move.l intuit,a6 get intuition base
move.l ib_ActiveScreen(a6),a1 get Active screen
cmpi.w #9,sc_MouseY(a1) is Y pointer in menu area?
bhi blanktests no
cmpi.b #'r',mouseright right mouse button down?
bne blanktests no
move.b #$ff,menuswitch set menuswitch
bra blanktests
testrupnol
cmpi.w #IECODE_RBUTTON+IECODE_UP_PREFIX,ie_Code(a0) r up?
bne testrset
clr.b menuswitch
move.b #0,mouseright reset set state
bra blanktests
testrset
cmpi.b #'r',mouseright r set?
bne blanktests no
cmpi.w #IECODE_LBUTTON+IECODE_UP_PREFIX,ie_Code(a0) l up?
bne blanktests no
tst.b menuswitch got a menu perhaps
bne blanktests don't remove l up
moveq #0,d0
move.w #CHECKED,d0
and.w cyclecheck,d0 do screen cycle specified?
beq blanktests no don't remove l up
move.b #IECLASS_NULL,ie_Class(a0) remove l button up
bra blanktests
testrightup
cmpi.b #'r',mouseright left been down already?
bne blanktests no
cmpi.w #IECODE_RBUTTON+IECODE_UP_PREFIX,ie_Code(a0) r up?
bne blanktests no
move.b #IECLASS_NULL,ie_Class(a0) remove right mouse button up
move.b #0,mouseright reset r button state
blanktests
tst.w blanktime off?
beq intdone yes
tst.b blankdone screen blank?
beq zerblank no
move.l a0,-(sp)
move.l blankscreen,a0
beq.s 1$
clr.b blankdone reset switch
* move.w #$8020,$dff000+$96 turn on sprite dma
move.l intuit,a6
jsr CloseScreen(a6) give back normal display
1$ move.l (sp)+,a0
move.w #0,blanktimer zero blank timer
bsr hellopoint
bra intdone
zerblank
move.w #0,blanktimer zero blank timer
cmp.b #IECLASS_RAWMOUSE,ie_Class(a0) mouse event?
bne intdone no
tst.w pointtime off?
beq intdone yes
tst.b pointdone pointer off?
beq pointclr no
bsr hellopoint
pointclr
move.w #0,pointtimer zero pointer time
bra intdone
hellopoint
clr.b pointdone
move.l a0,-(sp)
lea graphicsname,a1
MOVEQ #0,D0 ; load version number
MOVEA.L 4,A6 ; load exec library address
JSR OpenLibrary(A6) ; call OpenLibrary
tst.l d0
beq poiblank yes
move.l d0,a6 ok?
move.l gb_copinit(a6),a0 copper start-up
lea copinit_sprstrtup(a0),a1 sprite data
move.w spritesave,2(a1) top
move.w spritesave+2,6(a1) bottom
movea.l a6,A1 graphics Library
movea.l 4,a6 exec base
JSR CloseLibrary(A6) call CloseLibrary
* move.w #$8020,$dff000+$96 turn on sprite dma
poiblank
move.l (sp)+,a0 restore
poiblankn
move.w #0,pointtimer zero pointer time
rts
intdone
move.l ie_NextEvent(a0),d0 next event
beq.s eventout none
movea.l d0,a0
bra nextevent look at next
eventout
tst.b eventadd add buttons?
beq.s inputout no
clr.b eventadd
move.l #mouseevents,ie_NextEvent(a0) throw in buttons
clr.b eventadd clear switch
inputout
movem.l (a7)+,a0-a6/d1-d7 restore
move.l a0,d0 pass input event to next handler
rts
********** subroutine to clear time buffer **********
timeclear move.b #'0',(a2)+ clear
move.b #'0',(a2)+ clear
addq #1,a2
move.b #'0',(a2)+ clear
move.b #'0',(a2)+ clear
addq #1,a2
move.b #'0',(a2)+ clear
move.b #'0',(a2) clear
rts
************* subroutine to format memory display *******
formatmem moveq #0,d1 clear
move.l a2,-(a7) save a2
MOVE.L #$30303030,(a2) clear
move.b d0,d1 save low byte
lsr.l #8,d0 divide by 256 first
divu #3906,d0 get millions
add.b d0,(a2)+ put into display buffer
swap d0 get remainder
ext.l d0
divu #391,d0 get hundreds of thousands
add.b d0,(a2)+ make it printable
swap d0
ext.l d0
lsl.l #8,d0 get back the 256
divu #10000,d0 get tens of thousands
add.b d0,(a2)+ make it printable
swap d0
ext.l d0
divu #1000,d0 get thousands
add.b d0,(a2) make it printable
moveq #3,d0 count
move.l (a7)+,a2 restore
1$ cmpi.b #'0',(a2) is digit zero?
bne.s 2$ no
move.b #' ',(a2)+ blank it
dbra d0,1$ next one
2$ rts
******** sub-routine to scan menus for changes
menuscan
* look at task priority
moveq #7,d0
moveq #0,d1
lea priindex,a0 table of entries
prsearch
move.l (a0)+,a1 get address
move.w (a1),d1 get check field
andi.w #CHECKED,d1 is checked?
bne gotpri yes
dbra d0,prsearch
bra prinochange
gotpri
moveq #7,d1
sub.w d0,d1 get index
lea newpri,a0
moveq #0,d0
move.b 0(a0,d1),d0 get new priority
cmp.b priority,d0 changed?
beq prinochange no
move.b d0,priority save for save routine
movea.l task,a1 my task
movea.l 4,a6 exec base
jsr SetTaskPri(a6) call SetTaskPri
prinochange
* look at refresh rate
moveq #0,d1
move.w ref1,d1
moveq #0,d0
andi.w #CHECKED,d1 is it checked?
bne gotref yes
move.w ref2,d1
moveq #4,d0
andi.w #CHECKED,d1 is it checked?
bne gotref yes
move.w ref3,d1
moveq #8,d0
andi.w #CHECKED,d1 is it checked?
bne gotref yes
moveq #12,d0
gotref
lea newref,a0 refresh table
move.l 0(a0,d0),d1
cmp.l refrate,d1 new refresh rate?
beq norefchange
move.l d1,refrate
norefchange
* look at window to front
moveq #3,d0
moveq #0,d1
lea frontcheckr,a0 table of entries
frsearch
move.l (a0)+,a1 get address
move.w (a1),d1 get check field
andi.w #CHECKED,d1 is checked?
bne gotwtf yes
dbra d0,frsearch
bra wtfnochange
gotwtf
moveq #3,d1
sub.w d0,d1 get index
cmp.b wtfcount,d1 changed?
beq wtfnochange no
move.b d1,wtfcount save
wtfnochange
* look at window to back
moveq #3,d0
moveq #0,d1
lea backcheckr,a0 table of entries
basearch
move.l (a0)+,a1 get address
move.w (a1),d1 get check field
andi.w #CHECKED,d1 is checked?
bne gotwtb yes
dbra d0,basearch
bra wtbnochange
gotwtb
moveq #3,d1
sub.w d0,d1 get index
cmp.b wtbcount,d1 changed?
beq wtbnochange no
move.b d1,wtbcount save
wtbnochange
* look at screen blank
moveq #5,d0
moveq #0,d1
lea blankcheckr,a0 table of entries
blsearch
move.l (a0)+,a1 get address
move.w (a1),d1 get check field
andi.w #CHECKED,d1 is checked?
bne gotbla yes
dbra d0,blsearch
bra blanknochange
gotbla
moveq #5,d1
sub.w d0,d1 get index
lsl.l #1,d1
lea newblank,a0
move.w 0(a0,d1),d0 get new blank time
cmp.w blanktime,d0 changed?
beq blanknochange no
move.w d0,blanktime new screen blank time
clr.w blanktimer start new interval
blanknochange
* look at pointer blank
moveq #5,d0
moveq #0,d1
lea pointcheckr,a0 table of entries
posearch
move.l (a0)+,a1 get address
move.w (a1),d1 get check field
andi.w #CHECKED,d1 is checked?
bne gotpoi yes
dbra d0,posearch
bra pointnochange
gotpoi
moveq #5,d1
sub.w d0,d1 get index
lsl.l #1,d1
lea newpoint,a0
move.w 0(a0,d1),d0 get new blank time
cmp.w pointtime,d0 changed?
beq pointnochange no
move.w d0,pointtime new screen blank time
clr.w pointtimer start new interval
pointnochange
* look at mouse speed
moveq #5,d0
moveq #0,d1
lea mousecheck,a0 table of entries
mosearch
move.l (a0)+,a1 get address
move.w (a1),d1 get check field
andi.w #CHECKED,d1 is checked?
bne gotmou yes
dbra d0,mosearch
bra mousenochange
gotmou
moveq #5,d1
sub.w d0,d1 get index
lea newmouse,a0
move.b 0(a0,d1),d0 get new blank time
cmp.b mousespeed,d0 changed?
beq mousenochange no
move.b d0,mousespeed new mouse speed
mousenochange
rts
***************************************************
****************** window structure **********************
window dc.w 343 left edge
dc.w 1 top edge
dc.w 184 width
dc.w 7 Height
dc.b 0 detail pen
dc.b 1 block pen
dc.l ACTIVEWINDOW+INACTIVEWINDOW+MOUSEBUTTONS+MENUPICK IDCMPflags
dc.l WINDOWDRAG+NOCAREREFRESH+BORDERLESS flags
dc.l 0 first gadget
dc.l 0 check mark
dc.l 0 title
dc.l 0 screen
dc.l 0 bit map
dc.w 0 minimum width
dc.w 0 minimum height
dc.w 0 max width
dc.w 0 max height
dc.w 1 workbench
******************** menu structures ********************
menu0 dc.l 0 next menu
dc.w 50 left
dc.w 0 top
dc.w 80 width
dc.w 0 height
dc.w MENUENABLED flags
dc.l menu0name name
dc.l menuitem0 1st item
dc.w 0,0,0,0 internal
mendep equ 11 menu depth
mainw equ 130
menuitem0 dc.l menuitem1 next menu item
dc.w 0 left
dc.w 0 top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP flags
dc.l 0 mutual exclude
dc.l itemname0 item fill
dc.l 0 select fill
dc.b 'n' command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
itemname0 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itext0 text
dc.l 0 next text
itext0 dc.b 'NewCLI ',0
menuitem1 dc.l menuitem2 next menu item
dc.w 0 left
dc.w mendep top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP flags
dc.l 0 mutual exclude
dc.l itemname1 item fill
dc.l 0 select fill
dc.b 'd' command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
itemname1 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 Nfont
memtext dc.l itext1 text
dc.l 0 next text
itext1 dc.b 'Chip/Fast ',0
itext1b dc.b 'Total Memory ',0
menuitem2 dc.l menuitem3 next menu item
dc.w 0 left
dc.w mendep*2 top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP flags
dc.l 0 mutual exclude
dc.l itemname2 item fill
dc.l 0 select fill
dc.b 0 command
dc.l sub1 sub item
dc.w 0 next select
cnop 0,2 align
itemname2 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itext2 text
dc.l 0 next text
itext2 dc.b 'Colour ',0
menuitem3 dc.l menuitem4 next menu item
dc.w 0 left
dc.w mendep*3 top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP flags
dc.l 0 mutual exclude
dc.l itemname3 item fill
dc.l 0 select fill
dc.b 0 command
dc.l subp1 sub item
dc.w 0 next select
cnop 0,2 align
itemname3 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itext3 text
dc.l 0 next text
itext3 dc.b 'Priority ',0
priw equ 24+CHECKWIDTH
subp1 dc.l subp2 next menu item
dc.w mainw left
dc.w 0 top
dc.w priw width
dc.w mendep height
prich1 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffe mutual exclude
dc.l subnamep1 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamep1 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextp1 text
dc.l 0 next text
subtextp1 dc.b '-3 ',0
subp2 dc.l subp3 next menu item
dc.w mainw left
dc.w mendep top
dc.w priw width
dc.w mendep height
prich2 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffd mutual exclude
dc.l subnamep2 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamep2 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextp2 text
dc.l 0 next text
subtextp2 dc.b '-2 ',0
subp3 dc.l subp4 next menu item
dc.w mainw left
dc.w mendep*2 top
dc.w priw width
dc.w mendep height
prich3 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffb mutual exclude
dc.l subnamep3 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamep3 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextp3 text
dc.l 0 next text
subtextp3 dc.b '-1 ',0
subp4 dc.l subp5 next menu item
dc.w mainw left
dc.w mendep*3 top
dc.w priw width
dc.w mendep height
prich4 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fff7 mutual exclude
dc.l subnamep4 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamep4 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextp4 text
dc.l 0 next text
subtextp4 dc.b ' 0 ',0
subp5 dc.l subp6 next menu item
dc.w mainw+priw left
dc.w 0 top
dc.w priw width
dc.w mendep height
prich5 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $ffef mutual exclude
dc.l subnamep5 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamep5 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextp5 text
dc.l 0 next text
subtextp5 dc.b '+1 ',0
subp6 dc.l subp7 next menu item
dc.w mainw+priw left
dc.w mendep top
dc.w priw width
dc.w mendep height
prich6 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $ffdf mutual exclude
dc.l subnamep6 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamep6 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextp6 text
dc.l 0 next text
subtextp6 dc.b '+2 ',0
subp7 dc.l subp8 next menu item
dc.w mainw+priw left
dc.w mendep*2 top
dc.w priw width
dc.w mendep height
prich7 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $ffbf mutual exclude
dc.l subnamep7 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamep7 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextp7 text
dc.l 0 next text
subtextp7 dc.b '+3 ',0
subp8 dc.l 0 next menu item
dc.w mainw+priw left
dc.w mendep*3 top
dc.w priw width
dc.w mendep height
prich8 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $ff7f mutual exclude
dc.l subnamep8 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamep8 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextp8 text
dc.l 0 next text
subtextp8 dc.b '+4 ',0
colourw equ 74
sub1 dc.l sub2 next menu item
dc.w mainw left
dc.w 0 top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname1 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname1 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext1 text
dc.l 0 next text
subtext1 dc.b 'Colour 1 ',0
sub2 dc.l sub3 next menu item
dc.w mainw left
dc.w mendep top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname2 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname2 dc.b 2 front pen
dc.b 1 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext2 text
dc.l 0 next text
subtext2 dc.b 'Colour 2 ',0
sub3 dc.l sub4 next menu item
dc.w mainw left
dc.w mendep*2 top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname3 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname3 dc.b 3 front pen
dc.b 1 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext3 text
dc.l 0 next text
subtext3 dc.b 'Colour 3 ',0
sub4 dc.l sub5 next menu item
dc.w mainw+colourw left
dc.w 0 top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname4 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname4 dc.b 1 front pen
dc.b 0 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext4 text
dc.l 0 next text
subtext4 dc.b 'Colour 4 ',0
sub5 dc.l sub6 next menu item
dc.w mainw+colourw left
dc.w mendep top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname5 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname5 dc.b 2 front pen
dc.b 0 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext5 text
dc.l 0 next text
subtext5 dc.b 'Colour 5 ',0
sub6 dc.l sub7 next menu item
dc.w mainw+colourw left
dc.w mendep*2 top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname6 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname6 dc.b 3 front pen
dc.b 0 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext6 text
dc.l 0 next text
subtext6 dc.b 'Colour 6 ',0
sub7 dc.l sub8 next menu item
dc.w mainw+colourw*2 left
dc.w 0 top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname7 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname7 dc.b 0 front pen
dc.b 2 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext7 text
dc.l 0 next text
subtext7 dc.b 'Colour 7 ',0
sub8 dc.l sub9 next menu item
dc.w mainw+colourw*2 left
dc.w mendep top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname8 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname8 dc.b 1 front pen
dc.b 2 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext8 text
dc.l 0 next text
subtext8 dc.b 'Colour 8 ',0
sub9 dc.l sub10 next menu item
dc.w mainw+colourw*2 left
dc.w mendep*2 top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname9 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname9 dc.b 3 front pen
dc.b 2 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext9 text
dc.l 0 next text
subtext9 dc.b 'Colour 9 ',0
sub10 dc.l sub11 next menu item
dc.w mainw+colourw*3 left
dc.w 0 top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname10 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname10 dc.b 0 front pen
dc.b 3 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext10 text
dc.l 0 next text
subtext10 dc.b 'Colour 10',0
sub11 dc.l sub12 next menu item
dc.w mainw+colourw*3 left
dc.w mendep top"n
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname11 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname11 dc.b 1 front pen
dc.b 3 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext11 text
dc.l 0 next text
subtext11 dc.b 'Colour 11',0
sub12 dc.l 0 next menu item
dc.w mainw+colourw*3 left
dc.w mendep*2 top
dc.w colourw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHBOX flags
dc.l 0 mutual exclude
dc.l subname12 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subname12 dc.b 2 front pen
dc.b 3 back pen
dc.b RP_JAM2 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subtext12 text
dc.l 0 next text
subtext12 dc.b 'Colour 12',0
menuitem4 dc.l menuitem5 next menu item
dc.w 0 left
dc.w mendep*4 top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP flags
dc.l 0 mutual exclude
dc.l itemname4 item fill
dc.l 0 select fill
dc.b 0 command
dc.l subr1 sub item
dc.w 0 next select
cnop 0,2 align
itemname4 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itext4 text
dc.l 0 next text
itext4 dc.b 'Refresh ',0
refw equ 80+CHECKWIDTH
subr1 dc.l subr2 next menu item
dc.w mainw left
dc.w 0 top
dc.w refw width
dc.w mendep height
ref1 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fe mutual exclude
dc.l subnamer1 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamer1 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextr1 text
dc.l 0 next text
subtextr1 dc.b '10 per sec',0
subr2 dc.l subr3 next menu item
dc.w mainw left
dc.w mendep top
dc.w refw width
dc.w mendep height
ref2 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fd mutual exclude
dc.l subnamer2 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamer2 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextr2 text
dc.l 0 next text
subtextr2 dc.b ' 5 per sec',0
subr3 dc.l subr4 next menu item
dc.w mainw left
dc.w mendep*2 top
dc.w refw width
dc.w mendep height
ref3 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fb mutual exclude
dc.l subnamer3 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamer3 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextr3 text
dc.l 0 next text
subtextr3 dc.b ' 2 per sec',0
subr4 dc.l 0 next menu item
dc.w mainw left
dc.w mendep*3 top
dc.w refw width
dc.w mendep height
ref4 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $f7 mutual exclude
dc.l subnamer4 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamer4 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextr4 text
dc.l 0 next text
subtextr4 dc.b ' 1 per sec',0
menuitem5 dc.l menuitem6 next menu item
dc.w 0 left
dc.w mendep*5 top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP flags
dc.l 0 mutual exclude
dc.l itemname5 item fill
dc.l 0 select fill
dc.b 0 command
dc.l subb1 sub item
dc.w 0 next select
cnop 0,2 align
itemname5 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itext5 text
dc.l 0 next text
itext5 dc.b 'Blank Screen ',0
blaw equ 32+CHECKWIDTH
subb1 dc.l subb2 next menu item
dc.w mainw left
dc.w 0 top
dc.w blaw width
dc.w mendep height
blach1 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffe mutual exclude
dc.l subnameb1 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameb1 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextb1 text
dc.l 0 next text
subtextb1 dc.b 'OFF ',0
subb2 dc.l subb3 next menu item
dc.w mainw left
dc.w mendep top
dc.w blaw width
dc.w mendep height
blach2 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffd mutual exclude
dc.l subnameb2 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameb2 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextb2 text
dc.l 0 next text
subtextb2 dc.b ' 5 ',0
subb3 dc.l subb4 next menu item
dc.w mainw left
dc.w mendep*2 top
dc.w blaw width
dc.w mendep height
blach3 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffb mutual exclude
dc.l subnameb3 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameb3 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextb3 text
dc.l 0 next text
subtextb3 dc.b '10 ',0
subb4 dc.l subb5 next menu item
dc.w mainw+blaw left
dc.w 0 top
dc.w blaw width
dc.w mendep height
blach4 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fff7 mutual exclude
dc.l subnameb4 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameb4 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextb4 text
dc.l 0 next text
subtextb4 dc.b '20 ',0
subb5 dc.l subb6 next menu item
dc.w mainw+blaw left
dc.w mendep top
dc.w blaw width
dc.w mendep height
blach5 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $ffef mutual exclude
dc.l subnameb5 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameb5 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextb5 text
dc.l 0 next text
subtextb5 dc.b '30 ',0
subb6 dc.l 0 next menu item
dc.w mainw+blaw left
dc.w mendep*2 top
dc.w blaw width
dc.w mendep height
blach6 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $ffdf mutual exclude
dc.l subnameb6 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameb6 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextb6 text
dc.l 0 next text
subtextb6 dc.b '40 ',0
menuitem6 dc.l menuitem7 next menu item
dc.w 0 left
dc.w mendep*6 top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP flags
dc.l 0 mutual exclude
dc.l itemname6 item fill
dc.l 0 select fill
dc.b 0 command
dc.l subo1 sub item
dc.w 0 next select
cnop 0,2 align
itemname6 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itext6 text
dc.l 0 next text
itext6 dc.b 'Blank Pointer ',0
subo1 dc.l subo2 next menu item
dc.w mainw left
dc.w 0 top
dc.w blaw width
dc.w mendep height
poich1 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffe mutual exclude
dc.l subnameo1 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameo1 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtexto1 text
dc.l 0 next text
subtexto1 dc.b 'OFF ',0
subo2 dc.l subo3 next menu item
dc.w mainw left
dc.w mendep top
dc.w blaw width
dc.w mendep height
poich2 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffd mutual exclude
dc.l subnameo2 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameo2 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtexto2 text
dc.l 0 next text
subtexto2 dc.b ' 5 ',0
subo3 dc.l subo4 next menu item
dc.w mainw left
dc.w mendep*2 top
dc.w blaw width
dc.w mendep height
poich3 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffb mutual exclude
dc.l subnameo3 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameo3 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtexto3 text
dc.l 0 next text
subtexto3 dc.b '10 ',0
subo4 dc.l subo5 next menu item
dc.w mainw+blaw left
dc.w 0 top
dc.w blaw width
dc.w mendep height
poich4 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fff7 mutual exclude
dc.l subnameo4 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameo4 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtexto4 text
dc.l 0 next text
subtexto4 dc.b '20 ',0
subo5 dc.l subo6 next menu item
dc.w mainw+blaw left
dc.w mendep top
dc.w blaw width
dc.w mendep height
poich5 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $ffef mutual exclude
dc.l subnameo5 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameo5 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtexto5 text
dc.l 0 next text
subtexto5 dc.b '30 ',0
subo6 dc.l 0 next menu item
dc.w mainw+blaw left
dc.w mendep*2 top
dc.w blaw width
dc.w mendep height
poich6 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $ffdf mutual exclude
dc.l subnameo6 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnameo6 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtexto6 text
dc.l 0 next text
subtexto6 dc.b '40 ',0
menuitem7 dc.l menuitem8 next menu item
dc.w 0 left
dc.w mendep*7 top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP flags
dc.l 0 mutual exclude
dc.l itemname7 item fill
dc.l 0 select fill
dc.b 0 command
dc.l subm1 sub item
dc.w 0 next select
cnop 0,2 align
itemname7 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itext7 text
dc.l 0 next text
itext7 dc.b 'Mouse Speed ',0
subm1 dc.l subm2 next menu item
dc.w mainw left
dc.w 0 top
dc.w blaw width
dc.w mendep height
mouch1 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffe mutual exclude
dc.l subnamem1 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamem1 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextm1 text
dc.l 0 next text
subtextm1 dc.b '1 ',0
subm2 dc.l subm3 next menu item
dc.w mainw left
dc.w mendep top
dc.w blaw width
dc.w mendep height
mouch2 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffd mutual exclude
dc.l subnamem2 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamem2 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextm2 text
dc.l 0 next text
subtextm2 dc.b '2 ',0
subm3 dc.l subm4 next menu item
dc.w mainw left
dc.w mendep*2 top
dc.w blaw width
dc.w mendep height
mouch3 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fffb mutual exclude
dc.l subnamem3 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamem3 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextm3 text
dc.l 0 next text
subtextm3 dc.b '3 ',0
subm4 dc.l subm5 next menu item
dc.w mainw+blaw left
dc.w 0 top
dc.w blaw width
dc.w mendep height
mouch4 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fff7 mutual exclude
dc.l subnamem4 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamem4 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextm4 text
dc.l 0 next text
subtextm4 dc.b '4 ',0
subm5 dc.l subm6 next menu item
dc.w mainw+blaw left
dc.w mendep top
dc.w blaw width
dc.w mendep height
mouch5 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $ffef mutual exclude
dc.l subnamem5 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamem5 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextm5 text
dc.l 0 next text
subtextm5 dc.b '5 ',0
subm6 dc.l 0 next menu item
dc.w mainw+blaw left
dc.w mendep*2 top
dc.w blaw width
dc.w mendep height
mouch6 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $ffdf mutual exclude
dc.l subnamem6 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subnamem6 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextm6 text
dc.l 0 next text
subtextm6 dc.b '6 ',0
menuitem8 dc.l menuitem9 next menu item
dc.w 0 left
dc.w mendep*8 top
dc.w mainw width
dc.w mendep height
frontcheck dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l 0 mutual exclude
dc.l itemname8 item fill
dc.l 0 select fill
dc.b 0 command
dc.l subf1 sub item
dc.w 0 next select
cnop 0,2 align
itemname8 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itext8 text
dc.l 0 next text
itext8 dc.b 'Click to Front',0
frontf equ 70+CHECKWIDTH
subf1 dc.l subf2 next menu item
dc.w mainw left
dc.w 0 top
dc.w frontf width
dc.w mendep height
frontf1 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fe mutual exclude
dc.l subenamef1 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subenamef1 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextf1 text
dc.l 0 next text
subtextf1 dc.b 'OFF ',0
subf2 dc.l subf3 next menu item
dc.w mainw left
dc.w mendep top
dc.w frontf width
dc.w mendep height
frontf2 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fd mutual exclude
dc.l subenamef2 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subenamef2 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextf2 text
dc.l 0 next text
subtextf2 dc.b '1 Click ',0
subf3 dc.l subf4 next menu item
dc.w mainw left
dc.w mendep*2 top
dc.w frontf width
dc.w mendep height
frontf3 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fb mutual exclude
dc.l subenamef3 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subenamef3 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextf3 text
dc.l 0 next text
subtextf3 dc.b '2 Clicks',0
subf4 dc.l 0 next menu item
dc.w mainw left
dc.w mendep*3 top
dc.w frontf width
dc.w mendep height
frontf4 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $f7 mutual exclude
dc.l subenamef4 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subenamef4 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextf4 text
dc.l 0 next text
subtextf4 dc.b '3 Clicks',0
menuitem9 dc.l menuitem10 next menu item
dc.w 0 left
dc.w mendep*9 top
dc.w mainw width
dc.w mendep height
backcheck dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l 0 mutual exclude
dc.l itemname9 item fill
dc.l 0 select fill
dc.b 0 command
dc.l subu1 sub item
dc.w 0 next select
cnop 0,2 align
itemname9 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itext9 text
dc.l 0 next text
itext9 dc.b 'Click to Back ',0
backf equ 70+CHECKWIDTH
subu1 dc.l subu2 next menu item
dc.w mainw left
dc.w 0 top
dc.w backf width
dc.w mendep height
backf1 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fe mutual exclude
dc.l subenameu1 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subenameu1 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextu1 text
dc.l 0 next text
subtextu1 dc.b 'OFF ',0
subu2 dc.l subu3 next menu item
dc.w mainw left
dc.w mendep top
dc.w backf width
dc.w mendep height
backf2 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fd mutual exclude
dc.l subenameu2 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subenameu2 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextu2 text
dc.l 0 next text
subtextu2 dc.b '1 Click ',0
subu3 dc.l subu4 next menu item
dc.w mainw left
dc.w mendep*2 top
dc.w backf width
dc.w mendep height
backf3 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $fb mutual exclude
dc.l subenameu3 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subenameu3 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextu3 text
dc.l 0 next text
subtextu3 dc.b '2 Clicks',0
subu4 dc.l 0 next menu item
dc.w mainw left
dc.w mendep*3 top
dc.w backf width
dc.w mendep height
backf4 dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
dc.l $f7 mutual exclude
dc.l subenameu4 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subenameu4 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l subtextu4 text
dc.l 0 next text
subtextu4 dc.b '3 Clicks',0
menuitem10 dc.l menuitem11 next menu item
dc.w 0 left
dc.w mendep*10 top
dc.w mainw width
dc.w mendep height
suncheck dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT+MENUTOGGLE flags
dc.l 0 mutual exclude
dc.l itemname10 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
itemname10 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH
dc.w 2 top
dc.l 0 font
dc.l itext10 text
dc.l 0 next text
itext10 dc.b 'Sun Mouse ',0
menuitem11 dc.l menuitem12 next menu item
dc.w 0 left
dc.w mendep*11 top
dc.w mainw width
dc.w mendep height
cyclecheck dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT+MENUTOGGLE flags
dc.l 0 mutual exclude
dc.l itemname11 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
itemname11 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l itext11 text
dc.l 0 next text
itext11 dc.b 'Screen Cycle ',0
menuitem12 dc.l menuitem13 next menu item
dc.w 0 left
dc.w mendep*12 top
dc.w mainw width
dc.w mendep height
keycheck dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT+MENUTOGGLE flags
dc.l 0 mutual exclude
dc.l itemname12 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
itemname12 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l itext12 text
dc.l 0 next text
itext12 dc.b 'Key Activate ',0
menuitem13 dc.l menuitems next menu item
dc.w 0 left
dc.w mendep*13 top
dc.w mainw width
dc.w mendep height
wtfcheck dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT+MENUTOGGLE flags
dc.l 0 mutual exclude
dc.l itemname13 item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
itemname13 dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w CHECKWIDTH left
dc.w 2 top
dc.l 0 font
dc.l itext13 text
dc.l 0 next text
itext13 dc.b 'Pop to Front ',0
menuitems dc.l menuitemq next menu item
dc.w 0 left
dc.w mendep*14 top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP flags
dc.l 0 mutual exclude
dc.l itemnames item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
itemnames dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itexts text
dc.l 0 next text
itexts dc.b 'Save ',0
menuitemq dc.l menuitemc next menu item
dc.w 0 left
dc.w mendep*15 top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHCOMP flags
dc.l 0 mutual exclude
dc.l itemnameq item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
itemnameq dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itextq text
dc.l 0 next text
itextq dc.b 'Quit ',0
menuitemc dc.l 0 next menu item
dc.w 0 left
dc.w mendep*16 top
dc.w mainw width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHNONE flags
dc.l 0 mutual exclude
dc.l itemnamec item fill
dc.l 0 select fill
dc.b 0 command
dc.l subcredit sub item
dc.w 0 next select
cnop 0,2 align
itemnamec dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l itextc text
dc.l 0 next text
itextc dc.b 'Credits ',0
subcredit dc.l 0 next menu item
dc.w mainw left
dc.w 0 p
dc.w subcrtextl width
dc.w mendep height
dc.w ITEMTEXT+ITEMENABLED+HIGHNONE flags
dc.l 0 mutual exclude
dc.l subcreditm item fill
dc.l 0 select fill
dc.b 0 command
dc.l 0 sub item
dc.w 0 next select
cnop 0,2 align
subcreditm dc.b 0 front pen
dc.b 1 back pen
dc.b RP_JAM1 draw mode
dc.w 2 left
dc.w 2 top
dc.l 0 font
dc.l subcrtext text
dc.l 0 next text
newref dc.l 100000,200000,500000,999999 other refresh rates
newblank dc.w 0,300,600,1200,1800,2400 screen blank time
newpoint dc.w 0,5,10,20,30,40 pointer blank time
newmouse dc.b 0,1,2,3,4,5 mouse speeds
priindex dc.l prich1,prich2,prich3,prich4,prich5,prich6,prich7,prich8
mousecheck dc.l mouch1,mouch2,mouch3,mouch4,mouch5,mouch6
frontcheckr dc.l frontf1,frontf2,frontf3,frontf4
backcheckr dc.l backf1,backf2,backf3,backf4
blankcheckr dc.l blach1,blach2,blach3,blach4,blach5,blach6
pointcheckr dc.l poich1,poich2,poich3,poich4,poich5,poich6
************ words *********************************
seconds dc.w 0
newminutes dc.w 0
oldminutes dc.w 0
newcol dc.w $0001,$0201,$0301,$0100,$0200,$0300,$0002,$0102,$0302
dc.w $0003,$0103,$0203
************ bytes + bits and pieces **********
cnop 0,2
layersname dc.b 'layers.library',0
subcrtext dc.b ' David Jenkins ',$a9,' 1988 ',0
subcrtextl equ *-subcrtext-1
menu0name dc.b 'clockdj',0
savefile dc.b 'sys:clockdj.config',0
cnop 0,2
TimerPortName:
DC.B 'timer',0
cnop 0,2
TimerName:
DC.B 'timer.device',0,0
cnop 0,2
IntuitionName:
DC.B 'intuition.library',0
endmsg dc.b 0
oldsecs dc.b 0
cnop 0,2
dosname dc.b 'dos.library',0
cnop 0,2
graphicsname
dc.b 'graphics.library',0
code1 dc.w 0
newcli dc.b 'newcli >nil: <nil: "con:0/150/640/50/ clockdj "',0
newrest dcb.b 81-(*-newcli),0
nilname dc.b 'nil:',0
memtot equ 0
newpri dc.b -3,-2,-1,0,1,2,3,4
owsw dc.b 0
CNOP 0,2
inputname dc.b 'input.device',0
cnop 0,2
inputportname dc.b 'input.portdj',0
cnop 0,2
IntName DC.B 'input handler DJ',0
CNOP 0,2
********** IntuiText structures ****************
cnop 0,2 align
Date_Text:
DC.B 0,1,1,0
DC.W 0,0
DC.L 0,totmsg,0
cnop 0,2 align
ouch DC.B 3,0,1,0
DC.W 0,0
DC.L 0,ouchmsg,0
cnop 0,2
ouchmsg dc.b 'OUCH!',0 for Steve
********* text for IntuiText *************
cnop 0,2 align avail
totmsg dc.b ' '
avail dc.b ' 0000K'
dc.b ' '
buffer:
dc.B ' 00:00:00 '
ampm1 dc.b 'AM ',0
*********************************************
******** more text for IntuiText ************
cnop 0,2 align avail
dc.b 0
sepmsg dc.b ' '
dc.b ' Chip:'
chipavail dc.b '0000K'
dc.b ' Fast:'
fastavail dc.b ' 0000K '
buffer2:
dc.B ' 00:00:00 '
ampm2 dc.b 'AM ',0
*********************************************
**** new screen for screen blanking
newscreen
dc.w 0 ns_LeftEdge ; initial Screen dimensions
dc.w 0 ns_TopEdge ; initial Screen dimensions
dc.w 640 ns_Width ; initial Screen dimensions
dc.w 200 ns_Height ; initial Screen dimensions
dc.w 1 ns_Depth ; initial Screen dimensions
dc.b 0 ns_DetailPen ; default rendering pens (for Windows too)
dc.b 0 ns_BlockPen ; default rendering pens (for Windows too)
dc.w V_HIRES ns_ViewModes ; display "modes" for this Screen
dc.w CUSTOMSCREEN+SCREENQUIET ns_Type Screen Type specifier
dc.l 0 ns_Font ; default font for Screen and Windows
dc.l 0 ns_DefaultTitle ; Title when Window doesn't care
dc.l 0 ns_Gadgets ; Your own initial Screen Gadgets
mouseevents
dc.l 0 ie_NextEvent
dc.b IECLASS_RAWMOUSE ie_Class
dc.b 0 ie_SubClass
dc.w IECODE_RBUTTON+IECODE_UP_PREFIX ie_Code
dc.w 0 ie_Qualifier
dc.w 0 ie_X
dc.w 0 ie_Y
dc.l 0 tv_Seconds
dc.l 0 tv_Micros
******* this is the save record. Keep it together! ************
* *
cnop 0,2 *
diskbuffer equ * *
windowleft dc.w 343 *
windowtop dc.w 1 *
refrate dc.l 200000 default refresh rate *
colours dc.b 0,1 default colours *
memory dc.b 0 default total *
priority dc.b 2 *
pointtime dc.w 10 default pointer blank time *
blanktime dc.w 600 default screen blank time *
mousespeed dc.b 0 *
sunswitch dc.b 0 *
wtfcount dc.b 0 *
wtbcount dc.b 0 *
cycleswitch dc.b 0 *
keyswitch dc.b 0 *
popswitch dc.b 0 *
diskbufferl equ *-diskbuffer *
* *
*****************************************************************
cnop 0,2
event dcb.b ie_SIZEOF,0 save area for inspection
section data,bss
datarea
cnop 0,4
inthandler ds.b IS_SIZE interrupt handler
inputport ds.l 1 port address
cnop 0,4
inputreq ds.l IO_SIZE
insig ds.l 1
cnop 0,2
pause ds.b IOTV_SIZE ioreq for delay
layer ds.l 1
layers ds.l 1
layerinfo ds.l 1
tswitch ds.l 1
oldmem ds.l 1
class ds.l 1
intuit ds.l 1
timer ds.l 1
totalmemory ds.l 1
chipmemory ds.l 1
oldchip ds.l 1
oldfast ds.l 1
task ds.l 1 task pointer
wtfsecs ds.l 2
wtbsecs ds.l 2
wtbsecsnew ds.l 2
frontwin ds.l 1
backwin ds.l 1
blankscreen ds.l 1
spritesave ds.l 1
spriteblank ds.l 1
windowtab ds.l 240
windowtabl equ *-windowtab
blanktimer ds.w 1
pointtimer ds.w 1
mouseleft ds.b 1
mouseright ds.b 1
action ds.b 1
revswitch ds.b 1
eventadd ds.b 1
frontswitch ds.b 1 *
backswitch ds.b 1 *
blankdone ds.b 1
pointdone ds.b 1
lsw ds.b 1
lalt ds.b 1
lamiga ds.b 1
menuswitch ds.b 1
end